#ifndef __PCB_H_
#define __PCB_H_

#include "rtx_inc.h"
#include "messages.h"
#include "processes.h"

#define READY 0
#define BLOCKED_ON_RESOURCE 1
#define WAITING_FOR_MESSAGE 2
#define EXECUTING 3
#define INTERRUPTED 4
#define I_PROCESS 5

typedef struct process_control_block {
	struct process_control_block *next;
	UINT32 process_ID;
	UINT16 process_state;
	UINT16 priority;
	UINT32 *stack_pointer;
	UINT32 *program_counter;
	UINT32 status_register;
	UINT32 stack_size;
	MESSAGE* message_queue_head;
	MESSAGE* message_queue_tail;
} PCB;

PCB* get_pcb (UINT32 proc_ID);
VOID enqueue_message(PCB* pcb, MESSAGE* msg);
MESSAGE* dequeue_message(PCB* pcb);

#endif
